package cn.learn.designpattern.decorator.beverage;

/**
 * 测试使用
 * @author huangyezhan
 * @version 1.0
 * @date 2021年07月11日9:57
 */
public class TestEspresso {

    public static void main(String[] args) {
        /*
         * 饮料的装饰着模式
         */
        Espresso espresso = new Espresso();
        System.out.println(espresso.getDescription() + "，售价：￥" + espresso.cost());

        HouseBlend blend = new HouseBlend();
        System.out.println(blend.getDescription() + "，售价：￥" + blend.cost());


        System.out.println("———————————————————————————");

        Beverage beverage = new Espresso();
        System.out.println(beverage.getDescription() + "，售价：￥" + beverage.cost());
        Beverage mocha = new Mocha(beverage);
        System.out.println(mocha.getDescription() + "，售价：￥" + mocha.cost());

    }

}
